var user = {
  type: "admin",
  username: "Duke",
  account: "daiwenjun@chuangqish.com"
};
console.log(JSON.stringify(user));
var days = [];
var nums = [];

var time = new Date();
var year = time.getFullYear();
var month = time.getMonth() + 1;
var day = time.getDate();
month = month < 10 ? "0" + month : month;

for (var i = 0; i < 30; i++) {
  day--;
  if (day < 1) {
    day = 30;
    month--;
    month = month < 10 ? "0" + month : month;
  }
  var s_day = day < 10 ? "0" + day : day;
  days.push(year + "-" + month + "-" + s_day);
  nums.push(parseInt(Math.random() * 100));
}
var data = {
  labels: days,
  data: nums
};
console.log(data);
